<template>
  <!-- 运营与支付BI-项目 -->
  <div class="index-item-page">
    <!-- 顶部 -->
    <div class="header-box">
      <div class="back" @click="back">
        <i class="el-icon-back"></i><span>返回BI页</span>
      </div>
      <div class="item">
        <div :class="active == item.value ? 'active' : ''" @click="changeItem(item.value)" v-for="item in itemArr"
          :key="item.value">
          {{ item.label }}
        </div>
      </div>
      <div class="time"></div>
    </div>
    <div class="main-box bg">
      <plannedIncome v-if="active == 1"></plannedIncome>
      <salary v-if="active == 2"></salary>
      <lowOfAssets v-if="active == 3"></lowOfAssets>
      <taxesAndFees v-if="active == 4"></taxesAndFees>
      <otherCosts v-if="active == 5"></otherCosts>
      <cashAndSavings v-if="active == 7"></cashAndSavings>

    </div>
  </div>
</template>
<script>

import plannedIncome from "./components/plannedIncome.vue";
import taxesAndFees from "./components/taxesAndFees.vue";
import cashAndSavings from "./components/cashAndSavings.vue";
import lowOfAssets from "./components/lowOfAssets.vue";
import salary from "./components/salary.vue";
import otherCosts from "./components/otherCosts.vue";


export default {
  components: { plannedIncome, taxesAndFees, cashAndSavings, lowOfAssets, salary, otherCosts },
  data() {
    return {
      active: 1,
      itemArr: [
        { label: "计划收入", value: 1 },
        { label: "计划成本-工资", value: 2 },
        { label: "计划成本-资产低值", value: 3 },
        { label: "计划成本-税费抵扣", value: 4 },
        { label: "计划成本-招待隐性支出", value: 5 },
        { label: "利润", value: 6 },
        { label: "现金与储蓄", value: 7 },
        { label: "本期+历史应收", value: 8 },
        { label: "本期应付", value: 9 },
        { label: "资金状态", value: 10 },
      ],
    }
  },
  mounted() {
    this.active = this.$route.query.active
  },
  methods: {
    // 点击项目
    changeItem(val) {
      this.active = val;
    },
    // 返回上一页
    back() {
      this.$router.push({ path: "/report/financeReportBI" });
    },

  },
};
</script>
<style lang="scss" scoped>
.index-item-page {
  width: 100vw;
  min-height: 100vh;
  background-color: #dee0ed;
  position: relative;

  .header-box {
    height: 6vh;
    display: flex;
    justify-content: space-between;
    padding: 0 32px;
    background: #ffffff;

    >div {
      height: 100%;
      width: 15%;
      color: #666666;
      font-size: 16px;
      line-height: 6vh;
    }

    .back {
      cursor: pointer;
      color: #333;
    }

    .item {
      width: 70%;
      display: flex;
      margin: 0 auto;
      justify-content: center;
      font-weight: 400;
      font-size: 16px;
      color: #666666;

      div {
        padding: 0 32px;
        line-height: 6vh;
        cursor: pointer;
        overflow: hidden;
      }

      .active {
        background: linear-gradient(180deg,
            rgba(0, 79, 250, 0.2) 0%,
            rgba(0, 79, 250, 0) 100%);
        border-top: #004ffa 4px solid;
        font-weight: bold;
        color: #333;
        line-height: 5vh;
      }
    }

    .time {
      text-align: right;
    }
  }

  .bg {
    background-image: url('~@/assets/images/bgBI.png');
    background-size: 100% 100%;
  }

  .main-box {
    height: 94vh;
    padding: 30px 32px;

  }


}
</style>
